﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Shared/MasterHome.master" AutoEventWireup="true"
    CodeFile="Checkout.aspx.cs" Inherits="Checkout" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <h1 class="bigTitle">
        Checkout</h1>
    <asp:MultiView ID="MultiView1" runat="server">
        <asp:View runat="server">
            <h1 class="TitlePayment ">
                Type Payment</h1>
            <table style="width: 100%;">
                <tr>
                    <td>
                        Type Payment
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlTypePayment" runat="server" DataSourceID="SqlDataSource1"
                            DataTextField="tpName" DataValueField="tpId">
                        </asp:DropDownList>
                        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ShopConnectionString %>"
                            SelectCommand="SELECT * FROM [TypePayments] WHERE ([tpActive] = @tpActive)">
                            <SelectParameters>
                                <asp:Parameter DefaultValue="true" Name="tpActive" Type="Boolean" />
                            </SelectParameters>
                        </asp:SqlDataSource>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="btnNext1" runat="server" OnClick="btnNext_Click" Text="Next" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="View1" runat="server">
            <h1 class="TitlePayment">
                Payment</h1>
            <table style="width: 100%;">
                <tr>
                    <td>
                        Account Number
                    </td>
                    <td>
                        <asp:TextBox ID="txtAccNumber" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                            ControlToValidate="txtAccNumber" ErrorMessage="Not Empty" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        PIN
                    </td>
                    <td>
                        <asp:TextBox ID="txtPIN" runat="server"></asp:TextBox>
                    </td>
                    <td>
                        &nbsp;
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                            ControlToValidate="txtPIN" ErrorMessage="Not Empty" 
                            ForeColor="Red"></asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;</td>
                    <td>
                        <asp:Label ID="lblMessageAcc" runat="server" ForeColor="Red"></asp:Label>
                    </td>
                    <td>
                        &nbsp;</td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="btnNext2" runat="server" OnClick="btnNext2_Click" Text="Next" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View runat="server">
            <h1 class="TitlePayment">
                Address Delivery</h1>
            <table style="width: 100%;">
                <tr>
                    <td>
                        Address
                    </td>
                    <td>
                        <asp:TextBox ID="txtAddress" runat="server" Height="81px" TextMode="MultiLine" Width="379px"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                            ErrorMessage="Not Empty" ForeColor="Red" ControlToValidate="txtAddress"></asp:RequiredFieldValidator>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        <asp:Button ID="chkCheckout" runat="server" Text="Next" OnClick="chkCheckout_Click" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
            </table>
        </asp:View>
        <asp:View ID="View2" runat="server">
         <h1 class="TitlePayment">
                View Mycart</h1>
            <asp:ListView ID="ListView1" runat="server" 
                onitemcommand="ListView1_ItemCommand" onitemdatabound="ListView1_ItemDataBound">
                <AlternatingItemTemplate>
                    <tr style="background-color: #FFFFFF; color: #284775;">
                        <td>
                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("ProductCode") %>' />
                        </td>
                        <td>
                            <asp:Label ID="lblCode" runat="server" Text='<%# Eval("ProductCode") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%# Eval("Quantity") %>'></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>' />
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="Update" CommandName="add" /><br />
                        </td>
                        <td>
                            <asp:Button ID="Button2" runat="server" Text="Delete" CommandName="123" />
                        </td>
                    </tr>
                     <tr>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Not Empty" ForeColor="red" ControlToValidate="txtQuantity"></asp:RequiredFieldValidator>
                         &nbsp;
                    </tr>
                </AlternatingItemTemplate>
                <EmptyDataTemplate>
                    <table id="Table1" runat="server" style="background-color: #FFFFFF; border-collapse: collapse;
                        border-color: #999999; border-style: none; border-width: 1px;">
                        <tr>
                            <td>
                                No data was returned.
                            </td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <ItemTemplate>
                    <tr style="background-color: #FFFFFF; color: #284775;">
                        <td>
                            <asp:Label ID="lblName" runat="server" Text='<%# Eval("ProductCode") %>' />
                        </td>
                        <td>
                            <asp:Label ID="lblCode" runat="server" Text='<%# Eval("ProductCode") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="txtQuantity" runat="server" Text='<%# Eval("Quantity") %>'></asp:TextBox>
                        </td>
                        <td>
                            <asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price") %>' />
                        </td>
                        <td>
                            <asp:Button ID="Button1" runat="server" Text="Update" CommandName="add" />
                        </td>
                        <td>
                            <asp:Button ID="Button2" runat="server" Text="Delete" CommandName="123" />
                        </td>
                    </tr>
                    <tr>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Not Empty" ForeColor="red" ControlToValidate="txtQuantity"></asp:RequiredFieldValidator>
                         &nbsp;
                    </tr>
                </ItemTemplate>
                <LayoutTemplate>
                    <table id="Table2" runat="server">
                        <tr id="Tr1" runat="server">
                            <td id="Td1" runat="server">
                                <table id="itemPlaceholderContainer" runat="server" border="1" style="background-color: #FFFFFF;
                                    border-collapse: collapse; border-color: #999999; border-style: none; border-width: 1px;
                                    font-family: Verdana, Arial, Helvetica, sans-serif;">
                                    <tr id="Tr2" runat="server" style="background-color: #E0FFFF; color: #333333;">
                                        <th id="Th1" runat="server">
                                            Name
                                        </th>
                                        <th id="Th2" runat="server">
                                            ProductCode
                                        </th>
                                        <th id="Th3" runat="server">
                                            Quantity
                                        </th>
                                        <th id="Th4" runat="server">
                                            Price
                                        </th>
                                        <th id="Th5" runat="server">
                                            Update Quantity
                                        </th>
                                        <th id="Th6" runat="server">
                                             Delete
                                        </th>
                                    </tr>
                                    <tr id="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr id="Tr3" runat="server">
                            <td id="Td2" runat="server" style="text-align: center; background-color: #5D7B9D;
                                font-family: Verdana, Arial, Helvetica, sans-serif; color: #FFFFFF">                
                                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
            </asp:ListView>
            <asp:Button ID="Button3" runat="server" Text="Check Out" 
                onclick="Button3_Click" />
                
        </asp:View>
    </asp:MultiView>
</asp:Content>
